﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using devtm.Editor.TypeSelector.AttributeBuilder;

namespace devtm.Editor.TypeSelector.DefaultValue
{
    /// <summary>
    /// Interaction logic for SelectDefaulValueUserControl.xaml
    /// </summary>
    public partial class SelectDefaulValueUserControl : UserControl
    {


        public SelectDefaulValueUserControl()
        {
            InitializeComponent();
        }


        private Type _type;
        public Type Type
        {
            get { return _type; }
            set { _type = value; }
        }


        private object _value;

        public object Value
        {
            get { return _value; }
            set 
            { 
                _value = value;
            }
        }

        public string ValueString
        {
            get { return _value.ToString(); }
            set 
            {
                Value = Parameter.CastValue(_type, value);
            }
        }

    }
}
